-
Notifications
You must be signed in to change notification settings - Fork 3.1k
[exporter/elasticsearch] use validation for batcher #38072
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[exporter/elasticsearch] use validation for batcher #38072
Conversation
|
cc: @axw as you introduced batching in exporter. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While choosing sync vs async indexer, we use config.Enabled != nil. This doesn't really take the boolean stored in Enabled into account. It just checks if pointer is nil or not. It can be possible if pointer is non-nil and *config.Enabled is false.
It was done so for backwards compatibility. See README: https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/elasticsearchexporter#batching
We needed to retain the existing behavior of async bulk indexer, as exporterhelper batcher wasn't good enough to become the default at the time ( 😿 look at the discussions in #32632 dragged on for months). We should have a separate discussion whether it is good enough to completely replace async bulk indexer.
If the motivation of the PR is to validate the batcher struct, the way to go is to check for non-nil batcher config and call validate func on it.
|
@carsonip Thanks for your comment. I'll revert changes and call validate on it. |
|
FWIW, i think we can only focus on validation of batcher for this PR. And discuss other points in another followup issue. |
It is also intended. Any non nil batcher config disables async bulk indexer. i.e. if batcher config enabled is false, there will be no batching, and any request is blocked until indexed. if batcher config enabled is true, there is batching, and also blocks until the batch is indexed. There is only 1 case where batcher config is non-nil where the behavior is async, which is when sending queue is enabled. |
|
I see. I think I may have misunderstood the nuances. I assumed different stuff. |
e5f0dfc to
b29fff8
Compare
|
@carsonip I've only kept validation for this PR. PTAL! |
carsonip
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, thanks
Co-authored-by: Carson Ip <[email protected]>
Co-authored-by: Carson Ip <[email protected]>
axw
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just a nit about duplication
axw
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just a nit :)
425e80c to
4b4f1b1
Compare
|
Can someone from @open-telemetry/collector-contrib-approvers @open-telemetry/collector-contrib-maintainers approve this and merge it? It's already approved by codeowners but needs an approval from approvers/maintainers. |
|
@open-telemetry/collector-contrib-maintainers can we merge this ? |
|
unfortunately this broke mainline http://github.com/open-telemetry/opentelemetry-collector-contrib/actions/runs/13571662124/job/37938103918 |
Description
This PR fixes the validation for batcher.
exporterbatcher.Config(for backward compatibility). We ignore key validations done in exporterbatcher's validate.Testing
Added
Documentation